# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer:
pkgname=gutenprint
pkgver=5.3.4
pkgrel=3
pkgdesc="Top quality printer drivers for POSIX systems"
url="https://gimp-print.sourceforge.net/"
arch="all"
license="GPL-2.0-or-later"
makedepends="
	bash
	cups-dev
	gettext-dev
	ghostscript-dev
	libjpeg-turbo-dev
	libpng-dev
	libusb-dev
	tiff-dev
	"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-lang $pkgname-libs $pkgname-cups $pkgname-samples"
source="https://downloads.sourceforge.net/gimp-print/gutenprint-$pkgver.tar.xz"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-nls \
		--enable-cups-ppds \
		--enable-simplified-cups-ppds	
	make
}

package() {
	make DESTDIR="$pkgdir" install
	rm -r "$pkgdir"/usr/share/gutenprint/doc \
		"$pkgdir"/etc/cups/command.types
}

cups() {
	pkgdesc="CUPS drivers for Canon, Epson, HP and compatible printers"
	amove \
		usr/share/cups* \
		usr/lib/cups* \
		usr/bin/cups* \
		usr/sbin/cups* \
		etc/cups
}

samples() {
	pkgdesc="Sample test pattern generator for gutenprint-dev"
	amove \
		usr/share/gutenprint/samples \
		usr/bin/testpattern

}

sha512sums="
63de0b62edbe255a7efaaeab1dcd22577b7b46d7e0e48441b79977f19e76bf3862e4e8e18c55dd1f2e7392d555f9e8ee875ea53b90c689852d2343491a8fbcc8  gutenprint-5.3.4.tar.xz
"
